<link rel="stylesheet" href="{{ URL::asset('/ucenter/css/base.css') }}">
<style>
/*新的个人中心跟单记录 样式*/
.L_gendan .L_gdtitle {
    height: 50px;
    background: #1d2634;
}
.L_gendan .L_gdtitle ul li {
    float: left;
    font-size: 12px;
    color: #fff;
}
.L_gendan .L_gdtitle{
    height: 50px;
    margin-top: 30px;
    background: #1e2635;
    padding-left: 40px;
}
.L_gendan .L_gdtitle ul li {
    float: left;
    font-size: 12px;
    color: #fff;
    width: 50px;
    height: 24px;
    text-align: center;
    margin-top: 15px;
    border-radius: 2px;
    cursor: pointer;
}
.L_gendan .L_gdtitle ul li.active {
    color: #fff;
    background: #3b9ce0;
    border-radius: 2px;
    line-height: 24px;
    margin-top: 12px;
}
.L_gendan .L_gdtitle ul li.line {
    width: 1px;
    height: 14px;
    background: #88888b;
    margin-right: 10px;
}
.L_gendan .L_gdtitle ul li:nth-child(1),
.L_gendan .L_gdtitle ul li:nth-child(6) {
    color: #88888b;
}
.L_gendan .L_gdtitle ul li:nth-child(8),
.L_gendan .L_gdtitle ul li:nth-child(9),
.L_gendan .L_gdtitle ul li:nth-child(10) {
    width: 66px;
}
.L_gendan .L_gdtitle ul li:nth-child(6),
.L_gendan .L_gdtitle ul li:nth-child(10) {
    margin-left: 50px;
}
.L_gendan .L_gdtitle ul li select {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 102px;
    height: 24px;
    font-size: 12px;
    color: #3b9ce0;
    outline:none;
    cursor: pointer;
    background: url('../images/newcenterarrow.png') no-repeat scroll right center #fff;
}
.L_gendan .L_gdtitle ul select option {
    color: #20222c;
}
/* 选中的时候 背景颜色 */
.jybjcolor {
    background-color: #3b9ce0;
}
/* 默认全部有背景颜色 */
.L_gendan .L_gdtitle ul li.jybjcolor {
    background: #3b9ce0;
}
/* 下面列表 */
.L_gdcontent {
    width: 97%;
}
.L_gdcontent div {
    height: 54px;
    line-height: 54px;
    border-bottom: 1px solid #242630;
}
.L_gdcontent div ul li {
    float: left;
    color: #88888b;
    width: 9%;
    height: 54px;
    text-align: center;
    font-size: 12px;
}
.L_gdcontent div ul li p {
    line-height: 27px;
}
/* 分页 */
.L_gdcontent .L_page{
    padding-top: 35px;
    border-bottom: 0px solid #242630;
    padding-left: 77%;
}
.L_gdcontent .L_page span {
    color: #fff;
    font-size: 12px;
}
.L_gdcontent .L_page span.fpage {
    display: inline-block;
    width: 56px;
    height: 24px;
    background: #555f79;
    color: #fff;
    text-align: center;
    line-height: 24px;
    border-radius: 3px;
    cursor: pointer;
}
</style>
<script type="text/javascript" src="{{URL::asset('public_js/jquery-3.2.1.min.js')}}"></script>
<script>
    //page 页码;  pagetype :0 上一页 1 下一页; type : 0全部 1买多 2买空; dealtype : 1盈利交易 2：亏损交易 ; typename:交易种类
    function gotogendan(page,pagetype,type,dealtype,typename){
        typename = $('#typenamechange').val();
        var url = "?page="+(page+1)+"&pagetype="+pagetype+"&type="+type+"&dealtype="+dealtype+"&typename="+typename;
        url = '{{url("/newgendanlist")}}'+url;
        $(window.parent.document).find("#iframeNewGendan").attr("src",url);
    }
</script>

<div class="L_gendan">
    <div class="L_gdtitle">
        <ul>
            <li>按类型</li>
            <li class="line"></li>
            <li @if($type == 0) class="active" @endif onclick="gotogendan(0,0,0,'{{$dealtype}}','{{$typename}}')">全部</li>
            <li @if($type == 1) class="active" @endif onclick="gotogendan(0,0,1,'{{$dealtype}}','{{$typename}}')">买入</li>
            <li @if($type == 2) class="active" @endif onclick="gotogendan(0,0,2,'{{$dealtype}}','{{$typename}}')">卖出</li>
            <li>按盈亏</li>
            <li class="line"></li>
            <li @if($dealtype == 1) class="active" @endif onclick="gotogendan(0,0,'{{$type}}',1,'{{$typename}}')">盈利交易</li>
            <li @if($dealtype == 2) class="active" @endif onclick="gotogendan(0,0,'{{$type}}',2,'{{$typename}}')">亏损交易</li>
            <li>交易品种</li>
            <li>
                <select onchange="gotogendan(0,0,'{{$type}}','{{$dealtype}}','{{$typename}}')" id="typenamechange">
                    <option value="0">全部</option>
                    @foreach($typenames as $key=>$val)
                        <option value="{{$val->typename}}" @if($val->typename == $typename) selected="selected" @endif >{{$val->typename}}</option>
                    @endforeach
                </select>
            </li>
        </ul>
    </div>
    <div class="L_gdcontent">
        <div>
            <ul>
                <li>分析师</li> 
                <li>单号</li>
                <li>品种</li>
                <li>方向</li>
                <li>入场价格</li>
                <li>入场时间</li>
                <li>平仓价格</li>
                <li>平仓时间</li>
                <li>止盈</li>
                <li>止损</li>
                <li>最终盈亏</li>
        </div>
        @if($gendandata)
            @foreach($gendandata as $key=>$val)
            <div>
                <ul>
                    <li alt="{{$val->tradeid}}">{{$val->username}}</li>
                    <li>{{$val->tradeid}}</li>
                    <li>{{$val->typename}}</li>
                    <li>@if($val->buy_status == 0) 买入 @else 卖出 @endif</li>
                    <li>{{$val->begin_point}}</li>
                    <li>
                        <p>{{ date('H:i:s',$val->begin_time) }}</p>
                        <p>{{ date('Y-m-d',$val->begin_time) }}</p>
                    </li>
                    <li>{{$val->end_point}}</li>
                    <li>
                        @if($val->end_time)
                            <p>{{ date('H:i:s',$val->end_time) }}</p>
                            <p>{{ date('Y-m-d',$val->end_time) }}</p>
                        @endif
                    </li>
                    <li>{{$val->target_profit_point}}</li>
                    <li>{{$val->target_loss_point}}</li>
                    <li @if($val->profit >0) style="color:#fb405a;" @else style="color:#89ff29; @endif">{{$val->profit}}</li>
                </ul>
            </div>
            @endforeach
        @endif
        <!-- 分页 -->
        @if($totalpage != 0)
        <div class="L_page">
            @if($page == 1 || $page == 0)
                <span class="fpage">上一页</span>
            @else
                <span class="fpage" onclick='gotogendan({{$page}},0,"{{$type}}","{{$dealtype}}","{{$typename}}")' style='background: #3b9ce0;'>上一页</span>
            @endif
            &nbsp;
            <span>{{ $page }}</span>
            &nbsp;
            @if($page != $totalpage && $page<$totalpage)
                <span class="fpage" onclick='gotogendan({{$page}},1,"{{$type}}","{{$dealtype}}","{{$typename}}")' style='background: #3b9ce0;'>下一页</span>
            @else
                <span class="fpage">下一页</span>
            @endif
            &nbsp;
            <span>共&nbsp;<b>{{ $totalpage }}</b>&nbsp;页</span>
        </div>
        @endif
    </div>
</div>
